ga.core.evaluation
Class AbstractInteractiveEvaluator<T extends IIndividual<T>>

java.lang.Object
  extended by ga.core.evaluation.AbstractInteractiveEvaluator<T>
Type Parameters:
T - The generic type of the individuals.
All Implemented Interfaces:
IFitnessEvaluator<T>, IInteractiveFitnessEvaluator<T>

public abstract class AbstractInteractiveEvaluator<T extends IIndividual<T>>
extends java.lang.Object
implements IInteractiveFitnessEvaluator<T>

Abstract class for interactive fitness evaluators. This adds listener handling to the IInteractiveFitnessEvaluator interface.

Since:
11.08.2012
Author:
Stephan Dreyer

Field Summary
private  java.util.List<EvaluationListener<T>> listeners
           
 
Constructor Summary
AbstractInteractiveEvaluator()
           
 
Method Summary
 void addEvaluationListener(EvaluationListener<T> listener)
          Adds an EvaluationListener that will be notified about the evaluation state.
 void fireIndividualEvaluated(T individual)
          Notification method that causes all EvaluationListeners being notified that the evaluator has evaluated the individual.
 void fireNewIndividualRequested()
          Notification method that causes all EvaluationListeners being notified that the evaluator demands a new individual for evaluation.
 void removeEvaluationListener(EvaluationListener<T> listener)
          Adds an EvaluationListener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ga.core.evaluation.IInteractiveFitnessEvaluator
evaluate, getAlgorithm, setAlgorithm
 

Field Detail

listeners

private final java.util.List<EvaluationListener<T extends IIndividual<T>>> listeners
Constructor Detail

AbstractInteractiveEvaluator

public AbstractInteractiveEvaluator()
Method Detail

fireNewIndividualRequested

public void fireNewIndividualRequested()
Description copied from interface: IInteractiveFitnessEvaluator
Notification method that causes all EvaluationListeners being notified that the evaluator demands a new individual for evaluation.

Specified by:
fireNewIndividualRequested in interface IInteractiveFitnessEvaluator<T extends IIndividual<T>>

fireIndividualEvaluated

public void fireIndividualEvaluated(T individual)
Description copied from interface: IInteractiveFitnessEvaluator
Notification method that causes all EvaluationListeners being notified that the evaluator has evaluated the individual.

Specified by:
fireIndividualEvaluated in interface IInteractiveFitnessEvaluator<T extends IIndividual<T>>
Parameters:
individual - The evaluated individual.

addEvaluationListener

public void addEvaluationListener(EvaluationListener<T> listener)
Description copied from interface: IInteractiveFitnessEvaluator
Adds an EvaluationListener that will be notified about the evaluation state.

Specified by:
addEvaluationListener in interface IInteractiveFitnessEvaluator<T extends IIndividual<T>>
Parameters:
listener - The listener.

removeEvaluationListener

public void removeEvaluationListener(EvaluationListener<T> listener)
Description copied from interface: IInteractiveFitnessEvaluator
Adds an EvaluationListener.

Specified by:
removeEvaluationListener in interface IInteractiveFitnessEvaluator<T extends IIndividual<T>>
Parameters:
listener - The listener.